package com.ruoyi.system.domain;

import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 代金券操作记录，记录代金券全生命周期的操作日志及变更追踪对象 voucher_operation_log
 *
 * @author ruoyi
 * @date 2025-05-22
 */
public class VoucherOperationLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增主键ID，唯一标识每条操作记录 */
    private Long id;

    /** 代金券编号（关联代金券管理表的主键字段，如VCH20230001） */
    @Excel(name = "代金券编号", readConverterExp = "关=联代金券管理表的主键字段，如VCH20230001")
    private String voucherCode;

    /** 操作类型：创建代金券（create_voucher）、修改代金券（modify_voucher）、启用代金券（enable_voucher）、停用代金券（disable_voucher） */
    @Excel(name = "操作类型：创建代金券", readConverterExp = "c=reate_voucher")
    private String operationType;

    /** 操作开始时间（记录操作发起时刻，精确到秒） */
    @Excel(name = "操作开始时间", readConverterExp = "记=录操作发起时刻，精确到秒")
    private Date operationStartTime;

    /** 操作结束时间（记录操作完成时刻，允许为空以支持异步操作） */
    @Excel(name = "操作结束时间", readConverterExp = "记=录操作完成时刻，允许为空以支持异步操作")
    private Date operationEndTime;

    /** 操作员工ID（关联员工表的主键字段，用于追溯责任人） */
    @Excel(name = "操作员工ID", readConverterExp = "关=联员工表的主键字段，用于追溯责任人")
    private Long operatorId;

    /** 操作员工姓名（冗余字段，避免联表查询，提升查询效率） */
    @Excel(name = "操作员工姓名", readConverterExp = "冗=余字段，避免联表查询，提升查询效率")
    private String operatorName;

    /** 操作IP地址（用于安全审计，记录操作来源设备） */
    @Excel(name = "操作IP地址", readConverterExp = "用=于安全审计，记录操作来源设备")
    private String operationIp;

    /** 操作设备信息（如浏览器类型、客户端版本等，用于问题排查） */
    @Excel(name = "操作设备信息", readConverterExp = "如=浏览器类型、客户端版本等，用于问题排查")
    private String deviceInfo;

    /** 操作描述（可选字段，记录操作时的特殊说明或备注） */
    @Excel(name = "操作描述", readConverterExp = "可=选字段，记录操作时的特殊说明或备注")
    private String operationDescription;

    /** 关联业务ID（如审批单号、修改记录ID等，用于业务关联） */
    @Excel(name = "关联业务ID", readConverterExp = "如=审批单号、修改记录ID等，用于业务关联")
    private String relatedBusinessId;

    /** 是否回滚操作（1=是，0=否，用于标识操作是否被撤销） */
    @Excel(name = "是否回滚操作", readConverterExp = "1==是，0=否，用于标识操作是否被撤销")
    private Integer isRollback;

    /** 回滚关联记录ID（若为回滚操作，则指向原始操作记录的ID） */
    @Excel(name = "回滚关联记录ID", readConverterExp = "若=为回滚操作，则指向原始操作记录的ID")
    private Long rollbackRecordId;

    /** 手机号 */
    @Excel(name = "手机号")
    private String phone;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setVoucherCode(String voucherCode)
    {
        this.voucherCode = voucherCode;
    }

    public String getVoucherCode()
    {
        return voucherCode;
    }

    public void setOperationType(String operationType)
    {
        this.operationType = operationType;
    }

    public String getOperationType()
    {
        return operationType;
    }

    public void setOperationStartTime(Date operationStartTime)
    {
        this.operationStartTime = operationStartTime;
    }

    public Date getOperationStartTime()
    {
        return operationStartTime;
    }

    public void setOperationEndTime(Date operationEndTime)
    {
        this.operationEndTime = operationEndTime;
    }

    public Date getOperationEndTime()
    {
        return operationEndTime;
    }

    public void setOperatorId(Long operatorId)
    {
        this.operatorId = operatorId;
    }

    public Long getOperatorId()
    {
        return operatorId;
    }

    public void setOperatorName(String operatorName)
    {
        this.operatorName = operatorName;
    }

    public String getOperatorName()
    {
        return operatorName;
    }

    public void setOperationIp(String operationIp)
    {
        this.operationIp = operationIp;
    }

    public String getOperationIp()
    {
        return operationIp;
    }

    public void setDeviceInfo(String deviceInfo)
    {
        this.deviceInfo = deviceInfo;
    }

    public String getDeviceInfo()
    {
        return deviceInfo;
    }

    public void setOperationDescription(String operationDescription)
    {
        this.operationDescription = operationDescription;
    }

    public String getOperationDescription()
    {
        return operationDescription;
    }

    public void setRelatedBusinessId(String relatedBusinessId)
    {
        this.relatedBusinessId = relatedBusinessId;
    }

    public String getRelatedBusinessId()
    {
        return relatedBusinessId;
    }

    public void setIsRollback(Integer isRollback)
    {
        this.isRollback = isRollback;
    }

    public Integer getIsRollback()
    {
        return isRollback;
    }

    public void setRollbackRecordId(Long rollbackRecordId)
    {
        this.rollbackRecordId = rollbackRecordId;
    }

    public Long getRollbackRecordId()
    {
        return rollbackRecordId;
    }

    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public String getPhone()
    {
        return phone;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("voucherCode", getVoucherCode())
                .append("operationType", getOperationType())
                .append("operationStartTime", getOperationStartTime())
                .append("operationEndTime", getOperationEndTime())
                .append("operatorId", getOperatorId())
                .append("operatorName", getOperatorName())
                .append("operationIp", getOperationIp())
                .append("deviceInfo", getDeviceInfo())
                .append("operationDescription", getOperationDescription())
                .append("relatedBusinessId", getRelatedBusinessId())
                .append("isRollback", getIsRollback())
                .append("rollbackRecordId", getRollbackRecordId())
                .append("createTime", getCreateTime())
                .append("phone", getPhone())
                .toString();
    }
}
